<div
  bsModal
  #actionModal="bs-modal"
  class="modal fade"
  tabindex="-1"
  role="dialog"
  aria-labelledby="actionModal"
  aria-hidden="true"
  [config]="{ backdrop: 'static' }"
>
  <div class="modal-dialog modal-lg">
    <div class="modal-content">
      <form *ngIf="active" #editForm="ngForm" novalidate (ngSubmit)="save()">
        <div class="modal-header">
          <h4 class="modal-title"><span>修改材料位置</span></h4>
          <button type="button" class="close" (click)="close()" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>

        <div class="modal-body" style="padding-top: 0;">
          <div class="primeng-datatable-container" [busyIf]="primengTableHelper.isLoading">
            <h5 class="mb-4"><i class="fa fa-list"></i> 库存信息</h5>
            <p-table [value]="details" selectionMode="single" [(selection)]="selectedDetail" dataKey="id">
              <ng-template pTemplate="header">
                <tr>
                  <th width="40px"></th>
                  <th width="200px">位置</th>
                  <th width="100px">数量</th>
                </tr>
              </ng-template>
              <ng-template pTemplate="body" let-rowData>
                <tr [pSelectableRow]="rowData">
                  <td width="40px"><p-tableRadioButton [value]="rowData"></p-tableRadioButton></td>
                  <td width="200px">{{ rowData.positionName }}</td>
                  <td width="100px">{{ rowData.num }}</td>
                </tr>
              </ng-template>
            </p-table>
          </div>
          <h5 class="mb-4" style="margin-top: 20px;"><i class="fa fa-list"></i>位置信息</h5>
          <selectLocation [(location)]="positionId"></selectLocation>
        </div>

        <div class="modal-footer">
          <button [disabled]="saving" type="button" class="btn btn-default" (click)="close()">{{ l('Cancel') }}</button>
          <button type="submit" class="btn btn-success" [buttonBusy]="saving" [busyText]="'修改中...'">
            <i class="fa fa-check-circle"></i> <span>修改</span>
          </button>
        </div>
      </form>
    </div>
  </div>
</div>
